package com.hmall.item.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hmall.common.itemPojo.Item;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface ItemMapper extends BaseMapper<Item> {
    /**
     * 上下架
     * @param id
     * @param status
     */
    @Update("update tb_item set status = #{status} where id = #{id}")
    void upDuwn(Long id, Integer status);

    /**
     * 查询全部category
     */
    @Select("select category from tb_item")
    List<String> selectCategory();
    /**
     * 查询全部brand
     */
    List<String> selectBrand(String category);

    List<Item> selectConditional();

}
